package spider.dao;

public class SimpleSqlGenerator {
	public static String QueryGenerator(String table, String[] properties,
			int top) {
		String sql = "select * from "+table+" where ";
		for (String s : properties)
		{
			sql += s+"=? and ";
		}
		sql += "ROWNUM<"+top;
		return sql;
	}
	
	public static String QueryGenerator(String table, String[] properties) {
		String sql = "select * from "+table+" where ";
		for (String s : properties)
		{
			sql += s+"=? and ";
		}
		sql = sql.substring(0, sql.length()-4);
		return sql;
	}
}
